/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.srcptit.javatrainning.duongnt.b1;

import java.util.Scanner;

/**
 *
 * @author ThuyDuong
 */
public class Bai4Muc1Lietke {
public static boolean  ngto(int a) {
        if(a<=1) return false;
        for (int i = 2; i <= Math.sqrt(a); i++) 
        if (a % i == 0)
         return false;
        return true;
    }
    public static void main(String[] args) {
        int dem=0,a;
        System.out.println("nhap a");
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        for(int i=2;i<a;i++)
        {
            if(ngto(i)) System.out.println(i+" ");

        }
        }

}
